/*----------------------------------------------------------------------------------------
*
*  Copyright 2019, Gao Hai Hui, <fromzeropoint@126.com>.  All rights reserved.
*  https://gitee.com/helloworldghh/xoskit.git
*  Use of this source code is governed by a MIT license
*  that can be found in the License file.
*
----------------------------------------------------------------------------------------*/
#ifndef __CONFIG_CONFIG_H__
#define __CONFIG_CONFIG_H__

namespace xos_net
{

    class config
    {
    public:
        config();
        ~config();

    protected:
        int load( const char * lpszFile );
        int get_config();

    protected:
        // config obj
        xos_box::i_str_property * m_pConfigProp;
        xos_box::i_variant * m_pConfig;

    public:
        static config * get();
        static int init();
        static int term();

    public:
        // heart
        int heart_check_interval_ms;

        // net
        int tcp_max_post_accept;
        int tcp_max_post_recv;
        int tcp_max_post_send;
        int udp_max_post_recv;
        int udp_max_post_send;
        int max_connect_num;

        // timeout
        int first_data_timeout_s;
        int net_timeout_s;

    };

} // xos_net

#endif // __CONFIG_CONFIG_H__
